//==========================================================================
// Copyright (c) 2000-2008,  Elastos, Inc.  All Rights Reserved.
//==========================================================================
#ifndef __CWSTRINGINPUTSTREAM_H__
#define __CWSTRINGINPUTSTREAM_H__

#include "_CWStringInputStream.h"

CarClass(CWStringInputStream)
{
public:
    CARAPI Available(
        /* [out] */ Int32 * pBytes);

    CARAPI Close();

    CARAPI Mark(
        /* [in] */ Int32 readLimit);

    CARAPI IsMarkSupported(
        /* [out] */ Boolean * pSupported);

    CARAPI Read(
        /* [out] */ Byte * pByte);

    CARAPI ReadBuffer(
        /* [out] */ BufferOf<Byte> * pBuffer);

    CARAPI ReadBufferEx(
        /* [in] */ Int32 offset,
        /* [in] */ Int32 length,
        /* [out] */ BufferOf<Byte> * pBuffer);

    CARAPI Reset();

    CARAPI Skip(
        /* [in] */ Int32 length);

    CARAPI ReadWChar(
        /* [out] */ WChar * pCharacter);

    CARAPI ReadWCharArray(
        /* [out] */ BufferOf<WChar> * pcharArray);

    CARAPI ReadWCharArrayEx(
        /* [in] */ Int32 offset,
        /* [in] */ Int32 length,
        /* [out] */ BufferOf<WChar> * pcharArray);

    CARAPI ReadWString(
        /* [out] */ WStringBuf * pString);

    CARAPI constructor(
        /* [in] */ WString string);

    CWStringInputStream() : m_pBuf(NULL), m_pos(0), m_tail(0) {}

private:
    WChar * m_pBuf;
    Int32 m_pos;
    Int32 m_tail;
};

#endif // __CWSTRINGINPUTSTREAM_H__
